# $Id: PKGBUILD 144403 2011-12-05 14:57:02Z jgc $
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgbase=gnome-desktop-sharp
pkgname=('gnome-desktop-sharp' 'libgnome-desktop-sharp' 'gtkhtml-sharp' 'gtksourceview2-sharp' 'rsvg2-sharp' 'vte-sharp' 'wnck-sharp')
pkgver=2.26.0
pkgrel=8
arch=('i686' 'x86_64')
license=(LGPL)
url="http://gtk-sharp.sourceforge.net"
makedepends=('gnome-sharp' 'gnome-desktop2' 'vte' 'librsvg' 'libwnck' 'gtkhtml' 'gtksourceview2' 'monodoc')
options=('!libtool')
source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.bz2
	gnome-desktop-sharp-lib-target.patch)
md5sums=('4bc990900bb318b2ba0b0e7998bb47d1'
         '980cd3adf5e745f4caee0a172a51dcc3')

build() {
    export MONO_SHARED_DIR="$srcdir/wapi"
    mkdir -p "$MONO_SHARED_DIR"

    cd "$srcdir/$pkgname-$pkgver"
    patch -Np1 -i $srcdir/gnome-desktop-sharp-lib-target.patch
    ./configure --prefix=/usr --sysconfdir=/etc
    make
}

package_gnome-desktop-sharp() {
    pkgdesc="GNOME desktop bindings for C#"
    depends=('libgnome-desktop-sharp' 'gtkhtml-sharp' 'gtksourceview2-sharp' 'rsvg2-sharp' 'vte-sharp' 'wnck-sharp')
}

package_libgnome-desktop-sharp() {
    pkgdesc="Mono bindings for libgnome-desktop"
    depends=('gtk-sharp-2' 'gnome-desktop2')

    cd "$srcdir/$pkgbase-$pkgver"
    make -C gnomedesktop install DESTDIR="$pkgdir"
}

package_gtkhtml-sharp() {
    pkgdesc="Mono bindings for gtkhtml"
    depends=('gtk-sharp-2' 'gtkhtml')

    cd "$srcdir/$pkgbase-$pkgver"
    make -C gtkhtml install DESTDIR="$pkgdir"
}

package_gtksourceview2-sharp() {
    pkgdesc="Mono bindings for gtksourceview2"
    depends=('gtk-sharp-2' 'gtksourceview2')

    cd "$srcdir/$pkgbase-$pkgver"
    make -C gtksourceview install DESTDIR="$pkgdir"
}

package_rsvg2-sharp() {
    pkgdesc="Mono bindings for librsvg"
    depends=('gtk-sharp-2' 'librsvg')

    cd "$srcdir/$pkgbase-$pkgver"
    make -C rsvg install DESTDIR="$pkgdir"
}

package_vte-sharp() {
    pkgdesc="Mono bindings for libvte"
    depends=('gtk-sharp-2' 'vte')

    cd "$srcdir/$pkgbase-$pkgver"
    make -C vte install DESTDIR="$pkgdir"
}

package_wnck-sharp() {
    pkgdesc="Mono bindings for libwnck"
    depends=('gtk-sharp-2' 'libwnck')

    cd "$srcdir/$pkgbase-$pkgver"
    make -C wnck install DESTDIR="$pkgdir"
}
